/**
 * @class SafeNumber
 * @param { number } value
 * @description 自封装的安全 number类型 仅支持 int 不支持 float
 * @throws { TypeError }
 */
class SafeNumber {
    constructor(value) {
        value = parseInt(value);
        if (typeof value !== 'number' || isNaN(value)) {
            throw new TypeError(`Expected number, got ${typeof value}`);
        }
        this.value = value;
    }
}

module.exports = SafeNumber;